<?php

if(!defined('PATH')) exit();

class Admin extends Controller {

	protected $default_action = 'index';

	public $_title = 'Admin Panel';

	private $_error = false;

	public function __construct() {
		parent::__construct();
	}

	public function after() {
		parent::after();
	}

	public function before() {
		parent::before();
		if (!defined('LOGGED') || $this->archez->getLogged()->getCustomField('page_access') < ARCHEZ::ACCESS_ADMINISTRATOR) {
			$this->_error = true;
		}
	}

	public function action_index() {
		if ($this->_error)
			$this->redirect(PATH.'/'.$this->config['website']['index']);
		$view = new View('admin/index');
		$view->render();
	}
}
?>